﻿using System.Web.Mvc;
using ProjetoComperio.Framework.Web.Logging;
using ProjetoComperio.Framework.Web.Security;
using ProjetoComperio.SystemFramework.Web;
using ProjetoComperio.BusinessLogicLayer;

namespace ProjetoComperio.Presentation.Web.Controllers
{
    [RequiresAuthentication]
    public class HomeController : ComperioController
    {

        private ProjectBLL projectBLL;
        private EventBLL  eventBLL;
        private EducationalITApplicationBLL educationalITApplicationBLL;

        [RequiresAuthentication]
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Error()
        {
            return View();
        }


        [HttpGet]
        public ActionResult StartPage()
        {
            projectBLL = new ProjectBLL();
            ViewData["RecentProjectsList"] = projectBLL.RetrieveRecentProjects();

            eventBLL = new EventBLL();
            ViewData["RecentEventsList"] = eventBLL.RetrieveRecentEvents();
          
            educationalITApplicationBLL = new EducationalITApplicationBLL();
            ViewData["RecentEducationalITApplicationsList"] = educationalITApplicationBLL.RetrieveRecentEducationalITApplications(); 

            return View();
        }

    }


}
